home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / prog / mui / muirexx2.2 / demos / dock.rexx < prev    next >
OS/2 REXX Batch file  |  1996-08-22  |  6KB  |  165 lines

  1. /*
  2.  
  3. Code:       dock.rexx
  4. Author:     Russell Leighton
  5. Revision:   11 Apr 1996
  6.  
  7. Comments:  This is an example usage of MUIRexx to create a dock
  8. application.  It has some very powerful features that are best discovered
  9. by inspection.  So have fun :-)
  10.  
  11. */
  12. options results
  13. options failat 20
  14. arg comm flag
  15.  
  16. /* Method TAG ID definitions */
  17.  
  18. Application_OpenConfigWindow = 0x804299ba /*    { ULONG MethodID; ULONG flags; }; */
  19.  
  20. /* TAG ID definitions */
  21.  
  22. MUIA_Frame =                           0x8042ac64 /* V4  i.. LONG              */
  23. Draggable = '0x80420b6e'
  24. Weight = '0x80421d1f'
  25. Window_Borderless = '0x80429b79'
  26. Window_DepthGadget = '0x80421923'
  27. Window_SizeGadget = '0x8042e33d'
  28. Window_DragBar = '0x8042045d'
  29. InnerBottom = '0x8042f2c0'
  30. InnerLeft = '0x804228f8'
  31. InnerRight = '0x804297ff'
  32. InnerTop = '0x80421eb6'
  33. Group_Spacing = '0x8042866d'
  34. Menuitem_Checked = '0x8042562a'
  35. Menuitem_Checkit = '0x80425ace'
  36. Menuitem_Title = '0x804218be'
  37. Selected = '0x8042654b'
  38.  
  39. /* TAG variable definitions */
  40.  
  41. TRUE = 1
  42. FALSE = 0
  43.  
  44. address DOCK
  45.  
  46. select
  47.     when comm = 'MAIN' then call main
  48.     when comm = 'NET' then call net
  49.     when comm = 'TERM' then call term
  50.     when comm = 'UTIL' then call util
  51.     otherwise call main
  52. end
  53.  
  54. exit
  55.  
  56. main:
  57.  
  58. address DOCK
  59.  
  60. item ID WDRG ATTRS Menuitem_Checked
  61. dflag = (result=1)
  62. if dflag then attributes = Window_DragBar TRUE
  63. else attributes = Window_DepthGadget FALSE Window_SizeGadget FALSE Window_DragBar FALSE Window_Borderless TRUE
  64.  
  65. window ID DOCK CLOSE
  66. window ID DOCK ATTRS attributes InnerBottom 0 InnerLeft 0 InnerRight 0 InnerTop 0
  67.     menu LABEL '"Project"'
  68.         item COMMAND '"request TITLE About GADGETS OK FILE muidir:about.txt"' PORT DOCK LABEL '"About"'
  69.         menu LABEL '"Settings"'
  70.             item COMMAND '"method 'Application_OpenConfigWindow'"' PORT DOCK LABEL '"MUI..."'
  71.             item ID WDRG COMMAND '"muirexx:demos/dock MAIN DRAG"' LABEL '"Drag"' ATTRS Menuitem_Checkit TRUE Menuitem_Checked dflag
  72.         endmenu
  73.         item ATTRS Menuitem_Title '-1'
  74.         item COMMAND '"quit"' PORT DOCK LABEL '"Quit"'
  75.     endmenu
  76.     group HORIZ VIRTUAL ATTRS Group_Spacing 0
  77.         button ICON '"muirexx:demos/icons/help"' APP DROP COMMAND '"rexx:help %s"' ATTRS MUIA_Frame 0
  78.         button ICON '"muirexx:demos/icons/multiview"' APP DROP COMMAND '"sys:utilities/multiview %s"' PORT '"COMMAND"' ATTRS MUIA_Frame 0
  79.         button ICON '"muirexx:demos/icons/preview"' APP DROP COMMAND '"tex:c/preview %s"' PORT '"COMMAND"' ATTRS MUIA_Frame 0
  80.         button ICON '"muirexx:demos/icons/edit"' APP DROP COMMAND '"ced %s"' PORT '"COMMAND"' ATTRS MUIA_Frame 0
  81.         button ICON '"muirexx:demos/icons/music"' APP DROP COMMAND '"tools:music/Player"' PORT '"COMMAND"' ATTRS MUIA_Frame 0
  82.         button ICON '"muirexx:demos/icons/paint"' COMMAND '"tools:graphics/TVPaintJr/TVJunior.picasso"' PORT '"COMMAND"' ATTRS MUIA_Frame 0
  83.         button ICON '"muirexx:demos/icons/shell"' COMMAND '"newwsh CNC:0/593/560/240/New/close/alt#714,480,0,0 FROM S:WShell-Startup NAME WShell"' PORT '"COMMAND"' ATTRS MUIA_Frame 0
  84.         button ICON '"muirexx:demos/icons/dirutil"' COMMAND '"muirexx:demos/muidir/muidir DOCK"' ATTRS MUIA_Frame 0
  85.         button ICON '"muirexx:demos/icons/phone"' COMMAND '"template -hphonebook tools:utilities/template/phonebook"' PORT '"COMMAND"' ATTRS MUIA_Frame 0
  86.         button ICON '"muirexx:demos/icons/news"' COMMAND '"UUCP:GRn-2.1/GRn"' PORT '"COMMAND"' ATTRS MUIA_Frame 0
  87.         button ICON '"muirexx:demos/icons/mail"' COMMAND '"UUCP:c/Elm"' PORT '"COMMAND"' ATTRS MUIA_Frame 0
  88.         switch ID BNET ICON '"muirexx:demos/icons/network"' COMMAND '"muirexx:demos/dock NET"' ATTRS MUIA_Frame 0
  89.         switch ID BTRM ICON '"muirexx:demos/icons/term"' COMMAND '"muirexx:demos/dock TERM"' ATTRS MUIA_Frame 0
  90.         switch ID BUTL ICON '"muirexx:demos/icons/web"' COMMAND '"muirexx:demos/dock UTIL"' ATTRS MUIA_Frame 0
  91.         button ICON '"muirexx:demos/icons/apple"' COMMAND '"apps:ShapeShifter/ShapeShifter"' PORT '"COMMAND"' ATTRS MUIA_Frame 0
  92.     endgroup
  93. endwindow
  94.  
  95. return
  96.  
  97. net:
  98.  
  99. address DOCK
  100.  
  101. item ID NDRG ATTRS Menuitem_Checked
  102. dflag = (result=1)
  103. if dflag then attributes = Window_DragBar TRUE
  104. else attributes = Window_DepthGadget FALSE Window_SizeGadget FALSE Window_DragBar FALSE
  105. window ID WNET CLOSE
  106. switch ID BNET ATTRS Selected
  107. if result then do
  108.     window ID WNET ATTRS attributes
  109.         menu LABEL '"Settings"'
  110.             item ID NDRG COMMAND '"muirexx:demos/dock NET"' LABEL '"Drag"' ATTRS Menuitem_Checkit TRUE Menuitem_Checked dflag
  111.         endmenu
  112.         button COMMAND '"UUCP:s/uupoll"' PORT '"COMMAND"' LABEL 'poll'
  113.         button COMMAND '"AMITCP:bin/startnet"' PORT '"COMMAND"' LABEL 'startnet'
  114.         button COMMAND '"AMITCP:bin/stopnet"' PORT '"COMMAND"' LABEL 'stopnet'
  115.     endwindow
  116. end
  117.  
  118. return
  119.  
  120. term:
  121.  
  122. address DOCK
  123.  
  124. item ID TDRG ATTRS Menuitem_Checked
  125. dflag = (result=1)
  126. if dflag then attributes = Window_DragBar TRUE
  127. else attributes = Window_DepthGadget FALSE Window_SizeGadget FALSE Window_DragBar FALSE
  128. window ID WTRM CLOSE
  129. switch ID BTRM ATTRS Selected
  130. if result then do
  131.     window ID WTRM ATTRS attributes
  132.         menu LABEL '"Settings"'
  133.             item ID TDRG COMMAND '"muirexx:demos/dock TERM DRAG"' LABEL '"Drag"' ATTRS Menuitem_Checkit TRUE Menuitem_Checked dflag
  134.         endmenu
  135.         button COMMAND '"AMITCP:bin/napsaterm cello"' PORT '"COMMAND"' LABEL 'cello'
  136.         button COMMAND '"AMITCP:bin/napsaterm soyuz"' PORT '"COMMAND"' LABEL 'soyuz'
  137.         button COMMAND '"AMITCP:bin/napsaterm sputnik"' PORT '"COMMAND"' LABEL 'sputnik'
  138.     endwindow
  139. end
  140.  
  141. return
  142.  
  143. util:
  144.  
  145. address DOCK
  146.  
  147. item ID UDRG ATTRS Menuitem_Checked
  148. dflag = (result=1)
  149. if dflag then attributes = Window_DragBar TRUE
  150. else attributes = Window_DepthGadget FALSE Window_SizeGadget FALSE Window_DragBar FALSE
  151. window ID WUTL CLOSE
  152. switch ID BUTL ATTRS Selected
  153. if result then do
  154.     window ID WUTL ATTRS attributes
  155.         menu LABEL '"Settings"'
  156.             item ID UDRG COMMAND '"muirexx:demos/dock UTIL DRAG"' LABEL '"Drag"' ATTRS Menuitem_Checkit TRUE Menuitem_Checked dflag
  157.         endmenu
  158.         button COMMAND '"tools:Network/AMosaic/AMosaic"' PORT '"COMMAND"' LABEL 'AMosaic'
  159.         button COMMAND '"tools:Network/CLChat/Client/CLChatGUI"' PORT '"COMMAND"' LABEL 'CLChat'
  160.         button COMMAND '"tools:Network/Grapevine/GV"' PORT '"COMMAND"' LABEL 'Grapevine'
  161.     endwindow
  162. end
  163.  
  164. return
  165.